package cmd

import (
	"fmt"
	"github.com/spf13/cobra"
	"os"
)

func NewCommand() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "light-ftp",
		Short: "A light ftp CLI tool",
		Run: func(cmd *cobra.Command, args []string) {
			if err := cmd.Help(); err != nil {
				fmt.Println("light ftp help error.", err)
				os.Exit(1)
			}
		},
	}

	cmd.AddCommand(newConfigCommand())
	cmd.AddCommand(newLsCommand())
	cmd.AddCommand(newCpCommand())
	cmd.AddCommand(newRmCommand())

	return cmd
}
